<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <ul>
      <li>1</li>
      <li>2</li>
      <li>3</li>
    </ul>
    <script>
      var ul = document.querySelector("ul");
      //1.   node.cloneNode(); 括号为空或者里面是false 浅拷贝 只复制标签不复制里面的内容
      //2.   node.cloneNode(true); 括号为true 深拷贝 复制标签里的内容
      var lili = ul.children[0].cloneNode(true);
      ul.appendChild(lili);
    </script>
  </body>
</html>
